package com.atguigu.cdc;

/*import com.ververica.cdc.connectors.mysql.source.MySqlSource;
import com.ververica.cdc.connectors.mysql.table.StartupOptions;
import com.ververica.cdc.debezium.JsonDebeziumDeserializationSchema;
import org.apache.flink.api.common.eventtime.WatermarkStrategy;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

public class Flink_CDC_Json {
    public static void main(String[] args) throws Exception {

        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment().setParallelism(1);

        MySqlSource<String> build = MySqlSource
                .<String>builder()
                .hostname("hadoop102")
                .port(3306)
                .username("root")
                .password("1234")
                .databaseList("gmall2022")
                .tableList("gmall2022.base_trademark")
                .deserializer(new JsonDebeziumDeserializationSchema())
                .startupOptions(StartupOptions.initial())
                .build();

        DataStreamSource<String> mysql = env.fromSource(build, WatermarkStrategy.noWatermarks(), "mysql");

        mysql.print();

        env.execute();

    }
}*/
